#include <vector>
#include "settings.h"
#include "snake_body.h"

class Snake {
	friend class Food;
public:
	Snake(int x_head, int y_head, key_t direction) :
		x_head(x_head), y_head(y_head), direction(direction) {  }

	void add();
	void add(Food&);
	bool move(key_t);
	void draw();
	bool check_collision();
	void check_collision(Food&);
private:
	int x_head = SCREEN_WIDTH / 2, y_head = SCREEN_HEIGHT / 2;
	key_t direction = UP;
	std::vector<Snake_body> body;

	Snake_body create_body(int, int, key_t);
	bool check_move_available(key_t);
};

